翻訳と辞書
Words near each other
・ Array data structure
・ Array data type
・ Array DBMS
・ Array DVD magazine
・ Array factor
・ Array gain
・ ARRAY Magazine
・ Array mbira
・ Array Network Facility
・ Array Networks
・ Array of Jewels
・ Array of Low Energy X-ray Imaging Sensors
・ Array Operations Center
・ Array processing
・ Array programming
Array slicing
・ Arraya
・ Arraya de Oca
・ Arraya Tower
・ Arrayah.info
・ Arrayanaria
・ ArrayComm
・ Arraye-et-Han
・ Arrayed waveguide grating
・ Arrayent
・ ArrayFire
・ Arrayou-Lahitte
・ ArrayTrack
・ Arrayán
・ Arrayán (TV series)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Array slicing : ウィキペディア英語版
Array slicing

In computer programming, array slicing is an operation that extracts certain elements from an array and packages them as another array, possibly with different number of indices (or dimensions) and different index ranges. Two common examples are extracting a substring from a string of characters (e.g. "''ell''" from "h''ell''o"), and extracting a row (or a column) of a rectangular matrix to be used as a vector.
Depending on the programming language and context, the elements of the new array may be aliased to (i.e., share memory with) those of the original array.
==Details==
For "one-dimensional" (single-indexed) arrays — vectors, sequence, strings etc. — the most common slicing operation is extraction of zero or more consecutive elements. Thus, if we have a vector containing elements (2, 5, 7, 3, 8, 6, 4, 1), and we want to create an array slice from the 3rd to the 6th items, we get (7, 3, 8, 6). In programming languages that use a 0-based indexing scheme, the slice would be from index ''2'' to ''5''.
Reducing the range of any index to a single value effectively eliminates that index. This feature can be used, for example, to extract one-dimensional slices (vectors) or two-dimensional slices (rectangular matrices) from a three-dimensional array. However, since the range can be specified at run-time, type-checked languages may require an explicit (compile-time) notation to actually eliminate the trivial indices.
General array slicing can be implemented (whether or not built into the language) by referencing every array through a dope vector or ''descriptor'' — a record that contains the address of the first array element, and then the range of each index and the corresponding coefficient in the indexing formula. This technique also allows immediate array transposition, index reversal, subsampling, etc. For languages like C, where the indices always start at zero, the dope vector of an array with ''d'' indices has at least 1 + 2''d'' parameters. For languages that allow arbitrary lower bounds for indices, like Pascal, the dope vector needs 1 + 3''d'' entries.
If the array abstraction does not support true negative indices (as for example the arrays of Ada and Pascal do), then negative indices for the bounds of the slice for a given dimension are sometimes used to specify an offset from the end of the array in that dimension. In 1-based schemes, -1 generally would indicate the second-to-last item, while in a 0-based system, it would mean the very last item.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Array slicing」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.